<script setup lang="ts">
import { defineProps, ref, unref, defineEmits } from "vue"
import { CascaderOption } from "element-plus"

const props = defineProps(["menu"])
const emits = defineEmits(["fPid"])
const data = unref(ref<CascaderOption[]>(props.menu))

const change = (op: any) => {
  emits("fPid", op[op.length - 1])
}
</script>

<template>
  <el-cascader
    :options="data"
    @change="change"
    :props="{ checkStrictly: true, label: 'meta.title', value: 'id', children: 'child' }"
    clearable
  />
</template>
